/* 权限管理相关接口 */
import request from '@/utils/request'

// 1.获取所有权限点
export const reqGetPermission = () => {
  return request.get('/sys/permission')
}

// 2.添加权限点
export const reqAddPermission = data => {
  return request({
    method: 'post',
    url: '/sys/permission',
    data,
  })
}

// 3.根据id删除权限点
export const reqDelPermission = id => {
  return request({
    method: 'delete',
    url: `/sys/permission/${id}`,
  })
}

// 4.根据id更新权限点详情
export const reqEditPermission = data => {
  return request({
    method: 'put',
    url: `/sys/permission/${data.id}`,
    data,
  })
}

// 5.根据id获取权限点详情
export const reqGetPermissionDetail = id => {
  return request({
    method: 'get',
    url: `/sys/permission/${id}`,
  })
}
